package TankBuilder;



public class TankAssemblyLine implements IAssemblyLine {
	public BodyLineStep bodylinestep;
	public EngineLineStep enginelinestep;	
	public TowerLineStep towerlinestep;
	

	public TankAssemblyLine(BodyLineStep bodylinestep, EngineLineStep enginelinestep, TowerLineStep towerlinestep) {
		
		
		
		this.bodylinestep = bodylinestep;
		this.enginelinestep = enginelinestep;
		this.towerlinestep = towerlinestep;
		
		System.out.println("Tank Assembly line created");
	}

	
	public IProduct assembleProduct(IProduct tank) {
		
		System.out.println("Starting Tank assembly:");
		System.out.println("Starting first stage:");
		tank.installFirstPart(bodylinestep.buildProductPart());
		System.out.println("End first stage.");
		System.out.println("Starting second stage:");
		tank.installSecondPart(enginelinestep.buildProductPart());
		System.out.println("End second stage.");
		System.out.println("Starting third stage:");
		tank.installThirdPart(towerlinestep.buildProductPart());
		System.out.println("End third stage.");
		System.out.println("Tank assembly completed.");
		return tank;
	}

}
